//
//  NavigationViewTitleLeft.m
//  ZITHER
//
//  Created by weixin on 2019/5/27.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "NavigationViewTitleLeft.h"

@implementation NavigationViewTitleLeft


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, NaviHeight-1, kScreenW, 1)];
        [view setShadowType1WithColor:[UIColor defaultShadowColor] offset:CGSizeMake(0, 5) opacity:1 radius:3];
        [self addSubview:view];
         [self setUI];
        if ([Main_Token_Model_MANAGER.isToken isEqualToString:@"1"]){
            self.backgroundColor =  Main_Token_Model_MANAGER.backgroundColor ;
        }
    }
    return self;
}


-(void)setUI{
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(12);
        make.bottom.equalTo(self).offset(-10);
    }];
    [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-12);
        make.bottom.equalTo(self).offset(-10);
        make.width.height.mas_equalTo(30);
    }];
}

-(BaseLab *)title
{
    if (!_title) {
        _title = [BaseLab initCustomLab:@"交易" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:26]];
        [self addSubview:_title];
    }
    return _title;
}
//@[[UIImage imageNamed:@"未知图片"]]
-(BaseBtn *)rightBtn
{
    if (!_rightBtn) {
        _rightBtn = [BaseBtn initCustomBtn:@[@"未知图片"]];
        _rightBtn.backgroundColor = [UIColor redColor];
        [self addSubview:_rightBtn];
    }
    return _rightBtn;
}



@end
